<!--分期借款预览预览展示-->
<template>
  <div class="wrap" :class="{'show':isShow,'hide':!isShow}">
    <div class="sort" v-for="(item, index) in installment" :key="index">
      <div class="icon-question">{{ index + 1 }} st installment due</div>
      <div class="num">
        <div>₱ {{ item.amount }}</div>
        <div class="date">{{ item.day }} day of successful loan</div>
      </div>
    </div>
    <div class="footer" @click="()=>isShow=!isShow">
      <img v-if="!isShow" src="~@/assets/imgs/icon-toggle-line.png" alt="">
      <img v-if="isShow" src="~@/assets/imgs/icon-hide.png" alt="">
    </div>
  </div>
</template>

<script>
export default {
    props:{
        installment: {
          type: Array,
          default:()=> {
           return {
              contractAmount:0,
              loanPeriod:9
           }
          },
        },
    },
    data(){
      return {
        isShow:false
      }
    }
};
</script>

<style lang="scss" scoped>
    .wrap{
      position: relative;
      padding-bottom: 88px;
      .sort{
        padding-top: 20px;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        height: 124px;
        font-size: 28px;
        line-height: 34px;
        .num{
          text-align: right;
        }
         .date{
          color: #777;
          margin-top: 10px;
         }
        .icon-question{
          color: #777;
          background: none;
        }
      }
      .footer{
        height: 88px;
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 28px 0;
        background: white;
        text-align: center;
        img{
          width: 32px;
          height: 32px;
          
        }
      }
    }
    .hide{
      height: 212px;
      overflow: hidden;
    }
</style>